package com.GlobalPaint.app.ui.Mine.setting;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.GlobalPaint.app.R;

public class SettingActivity extends AppCompatActivity implements View.OnClickListener{

    private ImageView img_kg;
    private int num = 0;
    private ImageView iv_goback;
    private TextView tv_common_center;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_setting);
        initView();
    }

    private void initView() {
        img_kg = (ImageView) findViewById(R.id.img_kg);
        img_kg.setOnClickListener(this);
        iv_goback = (ImageView) findViewById(R.id.iv_goback);
        iv_goback.setOnClickListener(this);
        tv_common_center = (TextView) findViewById(R.id.tv_common_center);
        tv_common_center.setText("系统设置");
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()){
            case R.id.img_kg:
                num++;
                if (num % 2 == 0) {
                   img_kg.setImageResource(R.drawable.swich_off);
                }
                else {
                    img_kg.setImageResource(R.drawable.swich_on);
                }
                break;
            case R.id.iv_goback:
                finish();
                break;
        }
    }
}
